import {Message} from 'element-ui'

export default {
  init(){
    // 初始化users
    const myCachedData = localStorage.getItem('userInfo')
    return this.userInfo = JSON.parse(myCachedData)
  },
  // 常规跳转
  handleToTab(routerName){
    this.$router.push({name:routerName})
  },
  // 跳转新页签
  handleToNewTab(routerName){
    window.open(this.$router.resolve({name: routerName}).href, '_blank')
  },
  loginOut(){
    // let { cler } = window.sessionStorage.clear()
     localStorage.removeItem('userInfo')
  }
}
